package cn.lysj.framework.coupon.domain;

import cn.lysj.framework.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zwj
 * @description 优惠券
 * @create 2019-01-16 09:38:37
 **/
@Data
@Entity
@EqualsAndHashCode(callSuper=true)
public class Coupon extends BaseEntity {
    private String storeId;           //商户Id
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal fullReductionMoney;  //满减金额
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal discountMoney; //优惠金额
    private Integer shareType;        //份额类型 1.无限制 2.有限制 指定分发份数
    private Integer share;            //份额
    private Integer deadlineType;     //期限类型 1.商户指定优惠券开始时间 2.领取后计算开始结束时间
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date useBeginDate;        //期限开始时间
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date useEndDate;          //期限结束时间
    private Integer validPeriod;      //有效天数
    private String eventTitle;        //活动标题
    private String eventInfo;         //活动详情
    private String eventImg;          //活动图片
    private String qrCode;            //二维码图片

    public Coupon() {
    }
}
